package android.medicalcloud.com.yiapp.yilian.ui.fragment;

import android.graphics.Color;
import android.medicalcloud.com.yiapp.R;
import android.medicalcloud.com.yiapp.base.fragment.BaseFragment;
import android.medicalcloud.com.yiapp.yilian.ui.view.adapter.OrderMainPageAdapter;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.view.View;

/**
 * Created by wanggenlin on 17-5-18.
 */
public class OrderFragment extends BaseFragment {
    OrderMainPageAdapter adapter;
    ViewPager viewPager;
    TabLayout tabLayout;
    @Override
    protected void initView(View view) {
        viewPager = (ViewPager) view.findViewById(R.id.viewpager);
        tabLayout = (TabLayout) view.findViewById(R.id.sliding_tabs);
    }

    @Override
    protected void initEvent() {

    }

    @Override
    protected void initData() {
        adapter = new OrderMainPageAdapter(getChildFragmentManager(), getContext());
        viewPager.setAdapter(adapter);
        tabLayout.setupWithViewPager(viewPager);
        tabLayout.setTabMode(TabLayout.MODE_FIXED);
        tabLayout.setSelectedTabIndicatorColor(Color.parseColor("#6e7b8c"));

    }

    @Override
    protected int getLayoutId() {
        return R.layout.fra_order;
    }

    public static OrderFragment newInstance() {
        OrderFragment homeFragment = new OrderFragment();
        return homeFragment;
    }
}
